package solitaire.presentation;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

import solitaire.controle.CTasDeCartesAlternees;

@SuppressWarnings("serial")
public class PTasDeCartesAlternees extends PTasDeCartes{
	
	private JPanel backgroundPanel;
	private Dimension dimension;
	private CTasDeCartesAlternees controller;
	
	public PTasDeCartesAlternees(CTasDeCartesAlternees c){
		super(10, 10, c);
		this.controller = c;
		backgroundPanel = new JPanel();
		dimension = new Dimension(PCarte.largeur, PCarte.hauteur * 4);
		backgroundPanel.setSize(dimension);
		backgroundPanel.setPreferredSize(backgroundPanel.getSize());
		this.add(backgroundPanel);
		backgroundPanel.setBackground(Color.PINK);
		this.setVisible(true);
	}
	
	public static void main (String args []) {
		JFrame f = new JFrame("Test PTasDeCarteAlternees") ;
		f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		f.getContentPane ().setBackground(new Color(143, 143, 143));

		PCarte c1 = new PCarte ("QH", null);
		c1.setFaceVisible(true);

		PCarte c2 = new PCarte("KS", null);
		c2.setFaceVisible(true);
		
		PCarte c3 = new PCarte("1D", null);
		c3.setFaceVisible(true);

		PTasDeCartesAlternees ptc = new PTasDeCartesAlternees(null);
		
		ptc.empiler(c3);
		ptc.empiler(c2);
		ptc.empiler(c1);
		ptc.setVisible(true);
		
		f.getContentPane().add(ptc);
		
		f.setBounds(0, 0, PCarte.largeur, PCarte.hauteur*4);
		f.setVisible (true) ;
	} // main
	
}
